package com.yawn.zdweb.user;

import com.yawn.zdweb.controller.entity.RestResponse;
import com.yawn.zdweb.entity.User;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "zd-defect", fallback = UserServiceImpl.class)
public interface UserService {

    @PostMapping("/user/add")
    RestResponse add(@RequestBody User user);

    @GetMapping("/user/page")
    RestResponse page(@RequestParam("userId") String userId, @RequestParam("name") String name, @RequestParam("first") int first, @RequestParam("size") int size);

    @GetMapping("/group/list")
    RestResponse listGroup();

    @GetMapping("/user/list")
    RestResponse listByGroup(@RequestParam("groupId") String groupId);

    @GetMapping("/user/delete")
    void deleteUser(@RequestParam("userId") String userId);
}
